#include "Server.hpp"
#include "Dictionary.hpp"

int main(int argc, char* args[])
{
    if(argc != 2)
    {
        std::cerr << "Usage: Server + port" << std::endl;
        exit(errno); 
    }

    Dictionary dict;
    dict.Load();

    in_port_t port = std::stoi(args[1]);
    UDPServer server(port, [&dict](const std::string& message, const InetAddr& client){
        return dict.Check(message);
    });
    server.Start();
    return 0;
}